package top.program.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import top.program.dao.TeacherMapper;
import top.program.entity.Teacher;

@Service("teacherServiceImpl")
public class TeacherServiceImpl implements TeacherService  {
    @Autowired
    private TeacherMapper teacherMapper;

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int createTeacher(Teacher teacher) {
        teacherMapper.insertSelective(teacher);
        return 0;
    }
}
